<script type="text/javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function goto_url(url){
	if (url.indexOf("http://") > -1){
		location.href=url;
	} else {
		location.href = 'http://' + url;
	}
}
//-->
	
</script>
{% extends 'base.html' %}
{% block title %}  - User {{user_detail.username}} {% endblock %} 
              
	

{% block content %}
<div id="content" style="position:absolute; height:relative; min-height:600; top:20px; left:0px; width:610px; background-color: #1A1A1A; layer-background-color: #1A1A1A;">
<table width="400">

<tr>
	<td colspan="5">
		<p>
			<span style="font-size:14px;color:#CCC">
				{{user_detail.first_name}} {{user_detail.last_name}} - {{user_detail.get_profile.role}} 
			</span>
			<button onclick="window.location.href='/user/edit/all/?cu={{user_detail.id}}';">Edit</button>
		</p>
	</td>
</tr>

<tr><td colspan="5" align="center">
    <img src="{{user_detail.get_profile.photo}}" height="200">
</td></tr>

		{% if user_detail.get_profile.email != "" %}			
		<tr>
			<td width="80"><b>E-mail:</b></td>
            {% if user.id != user_detail.id %}
            <td colspan="4"><a href="mailto:{{user_detail.email}}" title="Send e-mail">{{user_detail.email}}</a></td>
        {% else %}
            <td colspan="4">{{user_detail.email}}</td>
            {% endif %}  
		</tr>
		{% endif %}  
       
        {% if user_detail.get_profile.phone != "" %}	
		<tr>
			<td><b>Phone:</b></td><td colspan="3">{{user_detail.get_profile.phone}}</td><td></td>
		</tr>
        {% endif %}
        
        {% if user_detail.get_profile.address != "" %}
		<tr>
			<td><b>Address:</b></td><td colspan="3">{{user_detail.get_profile.address}}</td><td></td>
		</tr>
    	{% endif %}
        
        {% if user_detail.get_profile.link != "" %}
		<tr>
			<td><b>URL:</b></td><td colspan="3">
				<a href="#" target="_new"
					onclick="goto_url('{{user_detail.get_profile.link}}'); return false;" 
				>{{user_detail.get_profile.link}}</a>
			</td><td></td>
		</tr>
		{% endif %}
        
        {% if user_detail.get_profile.company != "" %}
		<tr>
			<td><b>Company:</b></td><td colspan="3">{{user_detail.get_profile.company}}</td><td></td>
    </tr>
        {% endif %}
        
        {% if user_detail.get_profile.office != "" %}
        <tr>      
			<td><b>Office:</b></td><td colspan="3">{{user_detail.get_profile.office}}</td> <td></td>  
		</tr>
        {% endif %}	
        
        {% if user_detail.get_profile.rate != "" %}
        <tr>
			<td><b>Rate:</b></td><td colspan="3">{{user_detail.get_profile.rate}} 鈧�/td><td></td>
		</tr>
        {% endif %}	
        
        {% if user_detail.get_profile.language != "" %}
        <tr>
			<td><b>Language:</b></td><td colspan="3">{{user_detail.get_profile.language}}</td><td></td>
		</tr>
        {% endif %}
        
		<tr>
        {% if user_exp.start != user_exp.end %}
			<td><b>Unavailable:</b></td><td colspan="3">{{user_exp.start}}  ->  {{user_exp.end}}</td><td></td>
         {% endif %}
		</tr>

		{% for x in skts %}
		{% if x == 1 %}
  <tr>
		<td colspan="5"><b>Category:</b></td>
        </tr>
        {% endif %}
<tr>
			<td><b>{{x.category.name}}:</b></td>
			<td> <b>Skills:</b></td>
			<td>{% for y in x.skills %}
            {% if perms.users.is_producer or perms.users.is_kth %}
				<a href="/user/search/cats/?c={{x.category.id}}&s0={{y.skill.id}}"> {{y.skill.name}} <br></a>
            {% else %}
                {{y.skill.name}} <br>
            {% endif %}
			{% endfor %}
			</td>
			<td> <b> Tools: </b></td>
			<td>{% for z in x.tools %}
            {% if perms.users.is_producer or perms.users.is_kth %}
				<a href="/user/search/cats/?c={{x.category.id}}&t0={{z.tool.id}}">{{z.tool.name}} <br></a>
            {% else %}
            {{z.tool.name}} <br>
            {% endif %}            
			{% endfor %}
			</td>
		</tr>
		{% endfor %}
        {% if user_detail.get_profile.customer_skills %}    
        <tr><td>
		Special skills:
        </td>
        <td colspan="4">
        {{user_detail.get_profile.customer_skills}}      
        </td></tr>
        {% endif %}
 		<tr><td>
        Attachments:
        </td><td colspan="4">
         {% for attach in attachs %}
			{{attach.time|date:"Y-m-d"}} : 
			{% load zdy_filter %}
			<a href='/download/?path={{attach.file}}'>
				{{attach.file|download_file_name}}
			</a>
			<br>
		 {% endfor %}
        </td></tr>
        <tr><td>Client text</td>
        <td colspan="3">{{user_detail.get_profile.client_text}}</td>
        </tr>
        
  </table>
  <table width="400">
         {% if user.id != user_detail.id %}
        <tr><th colspan="2">
		<br/>Send upload request<br/>
        </td></tr>
        <form action="request/" method="post">
        <tr>
        <td>
		<textarea name="upload_request" rows="3" cols="40">Please upload a video! </textarea>
        </td>
        <td valign="bottom">
		<input type="submit" value="SEND"/>
        </td>
        </tr>
        </form>
        {% endif %}

	
        {% if perms.users.is_producer or perms.users.is_kth %}
        <tr><td colspan="2"; height="relative">
        <FORM><INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);return true;"> </FORM>
        </td></tr>
	{% endif %}
     </table>
  
	

<div id="movie_list" style="position:absolute; top:35px; left:415px; background-color: #1A1A1A">

	<p>Assets list |
		{% if movies.has_previous %}
		<a href="?page={{ movies.previous_page_number }}"><<<</a>
		{% endif %}
		Page {{ movies.number }} of {{ movies.paginator.num_pages }}.
		{% if movies.has_next %}
		<a href="?page={{ movies.next_page_number }}">>>></a>
		{% endif %}
	</p>
    
	{% for movie in movies.object_list %}
	
    <a href="/asset/{{movie.id}}/">
		{{movie.title}}
	</a><br/><br/>
	{% endfor %}
    </div>
</div>
{% endblock %}